package lab03.Test01;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.Buffer;

/**
 * Created by 李晓容 on 2017/11/16.
 */
public class Test01 {
    public static void main(String[] args) {
        //写文件-字符流
        String path="E:\\hello.txt";
        BufferedWriter writer=null;

        try {
           writer=new BufferedWriter(new FileWriter(path));
            writer.write("hello,world!");
            writer.newLine();
            writer.write("10001110111");
            writer.newLine();
            writer.write("bye!!!");
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}


